package com.ssy.lingxi.settle.accounts.service;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.dto.request.PlatformCommunicationPayVO;
import com.ssy.lingxi.dto.response.PlatformSettlementAllInPayVO;
import com.ssy.lingxi.order.api.model.vo.response.MemberSettleChannelVO;
import com.ssy.lingxi.order.api.model.vo.response.PlatformSettlementTypeVO;
import com.ssy.lingxi.settle.accounts.model.bo.PayProveBO;
import com.ssy.lingxi.settle.accounts.model.vo.request.*;
import com.ssy.lingxi.settle.accounts.model.vo.response.CommunicationPayProveVO;
import com.ssy.lingxi.settle.accounts.model.vo.response.PagePlatformSettlementDetailVO;
import com.ssy.lingxi.settle.accounts.model.vo.response.PlatformSettlementDetailVO;
import com.ssy.lingxi.settle.accounts.model.vo.response.PlatformSettlementVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 平台结算接口
 * @author 伍将
 * @date 2020/10/28
 * @version 2.0.0
 */
public interface IPlatformSettlementService {

    /**
     * 分页查询应收账款结算
     * @author 伍将
     * @date 2020/10/29
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.PlatformSettlementVO>>
     **/
    Wrapper<PageData<PlatformSettlementVO>> pageReceivableSettlement(UserLoginCacheDTO sysUser, PlatformSettlementPageVO pageVO);


    /**
     * 确认对账完成
     * @author 伍将
     * @date 2020/10/29
     * @param sysUser:
     * @param completeVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> confirmAccountComplete(UserLoginCacheDTO sysUser, ConfirmAccountCompleteVO completeVO);

    /**
     * 确认付款凭证
     * @author 伍将
     * @date 2020/10/29
     * @param sysUser:
     * @param confirmVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> confirmPayProve(UserLoginCacheDTO sysUser, ConfirmPayProve confirmVO);

    /**
     * 收款方查看凭证
     * @author 伍将
     * @date 2020/10/29
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<java.util.List < com.ssy.lingxi.settle.accounts.mode.bo.PayProveBO>>
     **/
    Wrapper<List<PayProveBO>> getReceivablePayProve(UserLoginCacheDTO sysUser, Long id);

    /**
     * 获取应收款账款结算详情
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.settle.accounts.mode.vo.response.PlatformSettlementDetailVO>
     **/
    Wrapper<PlatformSettlementDetailVO> getReceivableDetail(UserLoginCacheDTO sysUser, Long id);

    /**
     * 分页查询应收款账款结算详情
     * @author 伍将
     * @date 2020/10/30
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.PagePlatformSettlementDetailVO>>
     **/
    Wrapper<PageData<PagePlatformSettlementDetailVO>> pageReceivableSettlementDetail(UserLoginCacheDTO sysUser, PlatformSettlementDetailPageVO pageVO);

    /**
     * 分页查询应付账款结算
     * @author 伍将
     * @date 2020/10/29
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.PlatformSettlementVO>>
     **/
    Wrapper<PageData<PlatformSettlementVO>> pagePayableSettlement(UserLoginCacheDTO sysUser, PlatformSettlementPageVO pageVO);

    /**
     * 付款
     * @author 伍将
     * @date 2020/10/29
     * @param sysUser:
     * @param payVO:
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> pay(UserLoginCacheDTO sysUser, PayVO payVO);

    /**
     * 付款方查看凭证
     * @author 伍将
     * @date 2020/10/23
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<java.util.List < com.ssy.lingxi.settle.accounts.mode.bo.PayProveBO>>
     **/
    Wrapper<List<PayProveBO>> getPayablePayProve(UserLoginCacheDTO sysUser, Long id);

    /**
     * 获取应付账款结算详情
     * @author 伍将
     * @date 2020/10/29
     * @param sysUser:
     * @param id:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.settle.accounts.mode.vo.response.MemberSettlementDetailVO>
     **/
    Wrapper<PlatformSettlementDetailVO> getPayableDetail(UserLoginCacheDTO sysUser, Long id);

    /**
     * 分页查询应付款账款结算详情
     * @author 伍将
     * @date 2020/10/30
     * @param sysUser:
     * @param pageVO:
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.PagePlatformSettlementDetailVO>>
     **/
    Wrapper<PageData<PagePlatformSettlementDetailVO>> pagePayableSettlementDetail(UserLoginCacheDTO sysUser, PlatformSettlementDetailPageVO pageVO);

    /**
     * 是否存在佣金
     * @author 伍将
     * @date 2021/1/21
     * @return Boolean
     **/
    Wrapper<Boolean> isExistsBrokerage();

    /**
     * 平台代收账款结算-通联支付付款
     * @author 彭冬冬
     * @date 2021/11/29
     * @param sysUser 登录用户
     * @param communicationPayVO 联通支付付款VO
     * @return 支付结果
     */
    Wrapper<Void> communicationPay(UserLoginCacheDTO sysUser, PlatformCommunicationPayVO communicationPayVO);

    /**
     * @author 彭冬冬
     * @date 2021/11/29
     * @param sysUser 登录用户
     * @param id 结算单号id
     * @return 平台结算
     */
    Wrapper<CommunicationPayProveVO> getCommunicationPayProve(UserLoginCacheDTO sysUser, Long id);

    /**
     * 查询结算结算支付方式
     * @author 彭冬冬
     * @date 2021/12/10
     * @return 查询结算结算支付方式
     */
    Wrapper<List<PlatformSettlementTypeVO>> findSettlementType();

    /**
     * 查询结算结算渠道方式
     * @author 彭冬冬
     * @date 2021/12/10
     * @param sysUser 登录用户
     * @return 查询结算结算渠道方式
     */
    Wrapper<List<MemberSettleChannelVO>> findSettlementChannel(UserLoginCacheDTO sysUser);

    /**
     * 根据平台结算明细中订单支付记录id，获取平台结算数据
     * @param paymentId 支付记录id
     * @return 平台结算数据
     */
    Wrapper<PlatformSettlementAllInPayVO> getPlatformSettlementByDetailPaymentId(Long paymentId);

    /**
     * 平台代收账款结算-详情-导出excel
     * @param sysUser 登录用户
     * @param response 响应
     * @param queryParameter 查询条件
     */
    void payableExport(UserLoginCacheDTO sysUser, HttpServletResponse response, PlatformSettlementDetailPageVO queryParameter);

    /**
     * 平台代收账款结算-详情-查询明细导出
     * @param sysUser 登录用户
     * @param response 响应
     * @param queryParameter 查询条件
     */
    void receivableExport(UserLoginCacheDTO sysUser, HttpServletResponse response, PlatformSettlementDetailPageVO queryParameter);
}
